package com.tianji.learning.service;

import com.tianji.api.dto.leanring.LearningLessonDTO;
import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.learning.domain.po.LearningLesson;
import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.learning.domain.vo.LearningLessonVO;
import com.tianji.learning.domain.vo.LearningPlanPageVO;

import java.util.List;

/**
 * <p>
 * 学生课程表 服务类
 * </p>
 *
 * @author author
 * @since 2023-11-06
 */
public interface ILearningLessonService extends IService<LearningLesson> {

    /**
     * 添加学生课程
     * @param userId
     * @param courseIds
     */
    void addUserLessons(Long userId, List<Long> courseIds);

    /**
     * 查询学生课程
     * @param query
     * @return
     */
    PageDTO<LearningLessonVO> queryMyLessons(PageQuery query);

    /**
     * 查询学生当前课程
     * @return
     */
    LearningLessonVO queryMyCurrentLesson();

    /**
     * 判断用户是否可以继续学习当前课程
     * @param courseId
     * @return
     */
    Long isLessonValid(Long courseId);

    /**
     * 查询用户课表中指定的课程状态
     * @param courseId
     * @return
     */
    LearningLessonVO queryLessonByCourseId(Long courseId);

    /**
     * 创建学习计划
     * @param courseId
     * @param freq
     */
    void createLearningPlan(Long courseId, Integer freq);

    /**
     * 查询学习计划
     * @param query
     * @return
     */
    LearningPlanPageVO queryMyPlans(PageQuery query);

    /**
     * 退款，删除课程
     * @param userId
     * @param aLong
     */
    void deleteCourseFromLesson(Long userId, Long aLong);

    /**
     * 统计课程学习人数
     * @param courseId
     * @return
     */
    Integer countLearningLessonByCourse(Long courseId);
}
